<html>
<head>
    <script src="https://ap-gateway.mastercard.com/checkout/version/49/checkout.js"
            data-error="errorCallback" data-cancel="cancelCallback">
    </script>
    <script type="text/javascript" th:inline="javascript">
        function errorCallback(error) {
            console.log(JSON.stringify(error))
        }

        function cancelCallback() {
            console.log('Payment cancelled')
        }

        Checkout.configure({
            merchant: [[${merchantId}]],
            order: {
                description: [[${orderDescription}]],
                id: [[${orderId}]]
            },
            session: {
                id: [[${sessionId}]]
            },
            interaction: {
                merchant: {
                    name: [[${merchantName}]],
                    address: {
                        line1: '200 Sample St',
                        line2: '1234 Example Town'
                    }
                }
            }
        });
        window.onload = function () {
            Checkout.showPaymentPage()
        }
    </script>
</head>
<body>
<!--<input type="button" value="Pay with Lightbox" onClick="Checkout.showLightbox();"/>
<input type="button" value="Pay with Payment Page" onClick="Checkout.showPaymentPage();"/>-->
</body>
</html>